<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function Sunxsh(obj) {
      this.name = "孙小双"
      this.say = function(callback) {
        alert(this.name)
        callback()
      }
      for(var key in obj) {
        this[key] = obj[key]
      }
    }

    var dd = new Sunxsh({
      name: '华天晓',age: 22, code: "huatianxiao", work(callback) {
        // console.log(this)
        this.workTo(_ => {
          console.log(this)
        })
        this.workTo(function() {
          console.log(this)
        })
      },
      workTo(callback) {
        // console.log(this)
        callback()
      }
    })

    dd.work()


  </script>
</body>
</html>